from typing import List


class Solution:
    def dailyTemperatures(self, temperatures: List[int]) -> List[int]:
        size = len(temperatures)
        answer = [0] * size
        st = [0]
        for i in range(1, size):
            while st and temperatures[i]>temperatures[st[-1]]:
                answer[st[-1]] = i - st[-1]
                st.pop()

            st.append(i)
        return answer

print(Solution().dailyTemperatures([73, 74, 75, 71, 69, 72, 76, 73]))
